<template>
  <div class="tree" style="margin-left: 10px">
    <div :key="index" v-for="(item, index) in data">
      {{ item.name }}
      <!-- <TreeItem v-if="item?.children?.length" :data="item.children"></TreeItem> -->
    </div>
  </div>
</template>
<script lang="ts" setup>
// import TreeItem from "./tree1.vue";
// 递归组件1

type TreeList = {
  name: string;
  icon?: string;
  children?: TreeList[] | [];
};

type Props = {
  data?: TreeList[];
};
defineProps<Props>();
</script>
<style lang="less" scoped>
.tree {
  font-size: 20px;
}
</style>
